package com.gxa.p2p.service.impl;

import com.gxa.p2p.mapper.LoginLogMapper;
import com.gxa.p2p.pojo.LoginLog;
import com.gxa.p2p.service.LoginInfoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * 用户登录信息查询接口实现类
 *
 * @author Longlin_Feng
 * @date 2020/8/1
 */
@Service
@Transactional
public class LoginInfoServiceImpl implements LoginInfoService {

  @Resource private LoginLogMapper loginLogMapper;

  /**
   * 查询系统所有历史记录
   *
   * @param userId 当前系统用户id
   * @return List<LoginLog>
   */
  @Override
  public List<LoginLog> findLoginHistory(Integer userId) {
    return loginLogMapper.selectByUserId(userId);
  }

  @Override
  public List<LoginLog> findLoginUser(Integer userId) {
    return loginLogMapper.findById(userId);
  }
}
